{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Classification: Instant Recognition With Caffe\n",
    "In this example we'll classify an image with the bundled CaffeNet model (which is based on the network architecture of Krizhevsky et al. for ImageNet).\n",
    "\n",
    "We'll compare CPU and GPU modes and then dig into the model to inspect features and the output."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1. Setup\n",
    "- First, set up Python, numpy and matplotlib"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# set up Python Enviornment: numpy for numerical routines and matplotlin for plotting\n",
    "\n",
    "import numpy as np \n",
    "import matplotlib.pyplot as plt \n",
    "# display plot in this notebook\n",
    "%matplotlib inline \n",
    "\n",
    "#set display defaults \n",
    "# large images \n",
    "plt.rcParams['figure.figsize'] = (10,10) \n",
    "# don't  interplolate: show square pixels \n",
    "plt.rcParams['image.interpolation'] = 'nearest' \n",
    "# use grayscale output rather than a (potenstially misleading) color heatmap\n",
    "plt.rcParams['image.cmap'] = 'gray'\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- Load Caffe"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# The caffe module needs to be on the Python path;\n",
    "# we'll add it here explicitly \n",
    "import sys \n",
    "# this file should be run from {caffe_root}/examples (otherwise change this line)\n",
    "caffe_root = '/home/amanullahtariq/caffe/examples/'\n",
    "sys.path.insert(0,caffe_root + 'python')\n",
    "\n",
    "# If you get \"No module named _caffe\", either you have not built pycaffe or you have the wrong path.\n",
    "import caffe"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- If needed, download the reference model (\"CaffeNet\", a variant of AlexNet)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os \n",
    "\n",
    "#if os.path "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Reference\n",
    "- Classification: Instant Recognition with Caffe [http://nbviewer.jupyter.org/github/BVLC/caffe/blob/master/examples/00-classification.ipynb]"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
